﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SC2parser.Parsing;
using SC2parser.Function;

namespace SC2parser.Model
{
    public enum Race { Terran, Protoss, Zerg, Random, Unknown};
    public class Player
    {
        private string name;

        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        private int wins;

        public int Wins
        {
            get { return wins; }
            set { wins = value; }
        }

        private string country;

        public string Country
        {
            get { return country; }
            set { country = value; }
        }

        private Race race;

        public Race Race
        {
            get { return race; }
            set { race = value; }
        }

        private List<User> voters;

        public List<User> Voters
        {
            get { return voters; }
            set { voters = value; }
        }
        
        
        public Player(string name, Race race, int wins, string country) :this(name, race, wins)
        {
            this.country = country;

            ImageFetcher playerPortrait = new ImageFetcher();
            playerPortrait.FetchImage(name);
        }

        public Player(string name, Race race, int wins)
        {
            this.name = name.stringToName();
            this.Race = race;
            this.wins = wins;
        }

        public Player(string name, string race, string wins, string country)
            : this(name, race, wins)
        {
            this.country = country;

            ImageFetcher playerPortrait = new ImageFetcher();
            playerPortrait.FetchImage(name);
        }

        public Player(string name, string race, string wins)
        {
            this.name = name.stringToName();
            this.Race = race.stringToRace();
            this.wins = wins.stringToWins();
        }

        public Player(string name, string race, int wins, string country)
            : this(name, race, wins)
        {
            this.country = country;

            ImageFetcher playerPortrait = new ImageFetcher();
            playerPortrait.FetchImage(name);
        }

        public Player(string name, string race, int wins)
        {
            this.name = name.stringToName();
            this.Race = race.stringToRace();
            this.wins = wins;
        }
        
    }
}
